// 3-4
class student{
	private String name;
	private int age;
	public Sring getName () {
	return name;
	}
	public void setName (String name) {
		this.name = name ;
	}
	public int getAge () {
		return age;
	}
	public void setName (int age) {
		if (age<=0){
			System.out.println ("您输入的年龄有误！");
		} else {
			this.age = age;
		}
	}
	public void read () {
		System.out.println ("大家好，我是"+name+", 年龄"+age);
	}
}
public class Example04 {
	public static void main (String[] args){
		Student stu = new Student () ;
		stu.setName("张三");
		stu.setAge(-18);
		stu.read () ;
	}
}
// 3-5
class Student{
	public Student () {
		System.out.printin ("调用了无参构造方法")；
	}
}
public class Example05 {
	public static void main (String[] args) {
	  System.out.println ("声明对象。。。")
		  Student stu = null;
	 System.out.println ("实例化对象。。。");
	   stu = new Student () ;
	}
	}
// 3-6
class Student{
	private String name ;
	private int age;
	public Student (String n, int a){
		name = n;
		age = a
	}
}
public void read () {
		System.out.println ("大家好，我是"+name+", 年龄"+age);
	}
	public class Example06 {
		public static void main (String[] args) {
			Student stu = new Student ("张三"，18) ;
			stu.read () ;
	}
}

// 3-7
class Student {
	private String name;
	private int age;
	public Student (){ }
	public Student (String n){
		name = n;
	}
	public Student (String n,int a) {
		name = n;
		age = a;
	}
	public void read () {
	System.out.println ("我是:"+name+", 年龄"+age);
}
public class Example06 {
	public static void main (String[] args) {
		Student stu1 = new Student ("张三");
		Student stu2 = new Student ("张三",18);
		stu1.read () ;
		stu2.read () ;

    }
  }